package com.zxq.demo.admin.controller;

import com.zxq.demo.admin.helper.JobHelper;
import com.zxq.demo.admin.model.ZxqJobInfo;
import com.zxq.demo.admin.service.ZxqJobService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;

import java.net.URLDecoder;
import java.util.*;

/**
 * index controller
 * @author zxq 2015-12-19 16:13:16
 */
@RestController
@RequestMapping("/")
public class RegistryController {

	private Set<String> requestUrls = new HashSet<>();

	@GetMapping("/registry")
	public String jobList(@RequestParam(value = "executorUrl") String executorUrl) {
		try {
			String url = URLDecoder.decode(executorUrl);
			JobHelper.addUrl(url);
			return "Success";
		} catch (Exception e) {
			return String.format("Url解析失败: %s", e.getMessage());
		}
	}

}
